<html>
<head>
<meta charset="utf-8">
<title>VueTest</title>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="js/axios.js"></script>
<script src="https://cdn.bootcss.com/qs/6.5.1/qs.min.js"></script>
<script src="js/MD5.js"></script>
</head>
<body>
<div id="app">

	  <div>
	  <button v-on:click="clickMe()">巴拉拉小魔仙，点击就送</button>
	  </div>
  
	  <div v-for="(value,key) in helloData">
	    {{ key }} : {{ value }} 
	  </div>	
	  	
</div>

<script>
 var app = new Vue({
  el: '#app',
  data: {
    helloData: {}
  },
  methods: {
    clickMe: function () {
      var obj = this;
      let password=hex_md5('111111')
      password=hex_md5(password)
      let from = { username: '15903401025', password: password};
      from =JSON.stringify(from)
      let sign=hex_md5(from)
      let params={
          from:from,
          sign:sign
      }
      axios.post('/mobileapi/login_staff.php?act=logingo',Qs.stringify(params)).then(function(response){
            var data = response.data
            console.log(data)
            if(data.login_type){
              sessionStorage.setItem('logo','1')
              sessionStorage.setItem('token',data.G_token)
            }
          }).catch(function (error) { 
              console.log(error); 
          });
        }
      }  
})
</script>
</body>
</html>